package cn.bj.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bj.beans.Yxzc;
import cn.bj.dao.YxzcMapper;

@Service
public class YxzcService {
	@Autowired
	YxzcMapper yxzcMapper;

	// 查询所有
	public List<Yxzc> selcectAllYxzc() {
		return yxzcMapper.selectByExample(null);
	}

	// 插入
	public int insrtYxzc(Yxzc yxzc) {
		return yxzcMapper.insert(yxzc);
	}

	// 删除
	public int deleteYxzc(Integer id) {
		return yxzcMapper.deleteByPrimaryKey(id);
	}

	// 查询单个
	public Yxzc selectById(Integer id) {
		return yxzcMapper.selectByPrimaryKey(id);
	}

	// 修改
	public int updateYxzc(Yxzc yxzc) {
		return yxzcMapper.updateByPrimaryKey(yxzc);
	}

}
